package cn.com.yx.ms.persistence;

import cn.com.yx.ms.application.web.ApiQueryBase;
import cn.com.yx.ms.domain.dbmodel.SysUser;
import cn.com.yx.ms.domain.sys.LoginLogModel;
import cn.com.yx.ms.domain.sys.MoveCommonModel;
import cn.com.yx.ms.domain.sys.ResetPasswordModel;
import cn.com.yx.ms.domain.sys.UserResetPwdModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    int deleteByPrimaryKey(String guid);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(String guid);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    List<SysUser> find(ApiQueryBase query);

    int selectCountByEname(@Param("ename") String ename);

    int selectCountByEnameAndPwd(@Param("ename") String ename, @Param("pwd") String pwd);

    SysUser selectByEName(String ename);

    int updateByOrgid(String orgid);

    int insertSysLoginLog(LoginLogModel loginLogModel);

    int selectByUserid(String userid);

    int selectByip(String ip);

    int updateByUserid(String userid);

    int updateByIp(String ip);

    List<MoveCommonModel> findMoveModels(@Param("table") String table,
                                         @Param("parentId") String parentId);

    void updateMoveModel(@Param("guid") String guid,
                         @Param("orderindex") String orderindex,
                         @Param("table")String table);
    List<MoveCommonModel> findDevMoveModels(@Param("table")String table,
                                            @Param("parentId")String parentId);
    List<MoveCommonModel> findUserMoveModels(@Param("table")String table,
                                             @Param("parentId")String parentId);
    List<MoveCommonModel> findScFileMoveModels(@Param("table") String table,
                                               @Param("parentId")String parentId);
    List<MoveCommonModel> findGgMoveModels(@Param("table")String table,
                                           @Param("parentId")String parentId);
    void updateDevMoveModel(@Param("guid")String guid,
                             @Param("orderindex")String orderindex,
                             @Param("table")String table);

    List<UserResetPwdModel> selectResertPwd(ApiQueryBase apiQueryBase);

    int insertResetPwd(@Param("userid")String userid);

    int updateResetPwd(ResetPasswordModel resetPasswordModel);

    ResetPasswordModel selectResetPwdByUserid(@Param("userid") String userid);
}